/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Control;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author theInterloper
 */
public class DBConnector {
    
    public Connection setUpConnection() throws SQLException {
     String driver= ("com.mysql.jdbc.Driver");
     
    
//        String url = "jdbc:mysql://mysql972.cp.blacknight.com/db1075072_craftShop";
//        Connection connection = DriverManager.getConnection(url,"u1075072_maker", "9791513782");
     
   
//        String url = "jdbc:mysql://172.17.1.48:82/mm4k00112173";
//        Connection connection = DriverManager.getConnection(url,"mm4k00112173", "k00112173");
        
        String url = "jdbc:mysql://localhost:3306/db1075072_craftShop";
        Connection connection = DriverManager.getConnection(url,"root", "");
           
     
     
     try {
            // Load database driver if not already loaded.
            Class.forName(driver);
           } catch(ClassNotFoundException cnfe) {
                System.err.println("Error loading driver: " + cnfe);
           } 
     return connection;
    }
    
}


